package com.konsung.ksdc.bean.netbean;

import android.os.Parcel;
import android.os.Parcelable;

import com.konsung.ksdc.bean.CommentInfoBean;

import java.util.ArrayList;
import java.util.List;

/**
 * 商品详情信息bean
 * Created by Administrator on 2016/5/24 0024.
 */
public class ProductDetailNetBean implements Parcelable {

    private String productId; // 商品ID

    private List<String> urls; // 商品图片地址

    private String productName; // 商品名字

    private String subTitle; // 商品标题

    private String marketPrice; // 产品市场价

    private String memberPrice; // 产品会员价

    private String shoppingers; // 已购买人数

    private String repertory; // 库存数量

    private List<CommentInfoBean> evaluates; //  评价信息

    private String paramUrl; // 商品参数图片地址

    /**
     * 获取商品轮播图片集合
     * @return 商品轮播图片集合
     */
    public List<String> getUrls() {
        return urls;
    }

    /**
     * 设置商品轮播图片集合
     * @param urls 商品轮播图片集合
     */
    public void setUrls(List<String> urls) {
        this.urls = urls;
    }

    /**
     * 获取商品id
     * @return 商品id
     */
    public String getProductId() {
        return productId;
    }

    /**
     * 设置商品id
     * @param productId 商品id
     */
    public void setProductId(String productId) {
        this.productId = productId;
    }

    /**
     * 获取商品名称
     * @return 商品名称
     */
    public String getProductName() {
        return productName;
    }

    /**
     * 设置商品名称
     * @param productName 商品名称
     */
    public void setProductName(String productName) {
        this.productName = productName;
    }

    /**
     * 获取商品标题
     * @return 商品标题
     */
    public String getSubTitle() {
        return subTitle;
    }

    /**
     * 设置商品标题
     * @param subTitle 商品标题
     */
    public void setSubTitle(String subTitle) {
        this.subTitle = subTitle;
    }

    /**
     * 获取商品原价
     * @return 商品原价
     */
    public String getMarketPrice() {
        return marketPrice;
    }

    /**
     * 设置商品原价
     * @param marketPrice 商品原价
     */
    public void setMarketPrice(String marketPrice) {
        this.marketPrice = marketPrice;
    }

    /**
     * 获取会员价
     * @return 会员价
     */
    public String getMemberPrice() {
        return memberPrice;
    }

    /**
     * 设置会员价
     * @param memberPrice 会员价
     */
    public void setMemberPrice(String memberPrice) {
        this.memberPrice = memberPrice;
    }

    /**
     * 获取商品已购买人数
     * @return 商品已购买人数
     */
    public String getShoppingers() {
        return shoppingers;
    }

    /**
     * 设置商品已购买人数
     * @param shoppingers 商品已购买人数
     */
    public void setShoppingers(String shoppingers) {
        this.shoppingers = shoppingers;
    }

    /**
     * 获取商品评价集合
     * @return 商品评价集合
     */
    public List<CommentInfoBean> getEvaluates() {
        return evaluates;
    }

    /**
     * 设置商品评价集合
     * @param evaluates 商品评价集合
     */
    public void setEvaluates(List<CommentInfoBean> evaluates) {
        this.evaluates = evaluates;
    }

    /**
     * 获取商品参数图片url
     * @return 商品参数图片url
     */
    public String getParamUrl() {
        return paramUrl;
    }

    /**
     * 设置商品参数图片url
     * @param paramUrl 商品参数图片url
     */
    public void setParamUrl(String paramUrl) {
        this.paramUrl = paramUrl;
    }

    /**
     * 获取商品库存
     * @return 商品库存
     */
    public String getRepertory() {
        return repertory;
    }

    /**
     * 设置商品库存
     * @param repertory 商品库存
     */
    public void setRepertory(String repertory) {
        this.repertory = repertory;
    }

    @Override
    public String toString() {
        return "ProductDetailNetBean{" +
                "productId='" + productId + '\'' +
                ", urls=" + urls +
                ", productName='" + productName + '\'' +
                ", subTitle='" + subTitle + '\'' +
                ", marketPrice='" + marketPrice + '\'' +
                ", memberPrice='" + memberPrice + '\'' +
                ", shoppingers='" + shoppingers + '\'' +
                ", evaluates=" + evaluates +
                ", paramUrl='" + paramUrl + '\'' +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.productId);
        dest.writeStringList(this.urls);
        dest.writeString(this.productName);
        dest.writeString(this.subTitle);
        dest.writeString(this.marketPrice);
        dest.writeString(this.memberPrice);
        dest.writeString(this.shoppingers);
        dest.writeList(this.evaluates);
        dest.writeString(this.paramUrl);
    }

    /**
     * 序列化实体类对象
     * @param in Parcel对象
     */
    protected ProductDetailNetBean(Parcel in) {
        this.productId = in.readString();
        this.urls = in.createStringArrayList();
        this.productName = in.readString();
        this.subTitle = in.readString();
        this.marketPrice = in.readString();
        this.memberPrice = in.readString();
        this.shoppingers = in.readString();
        this.evaluates = new ArrayList<CommentInfoBean>();
        in.readList(this.evaluates, CommentInfoBean.class.getClassLoader());
        this.paramUrl = in.readString();
    }

    public static final Parcelable.Creator<ProductDetailNetBean> CREATOR = new Parcelable
            .Creator<ProductDetailNetBean>() {
        @Override
        public ProductDetailNetBean createFromParcel(Parcel source) {
            return new ProductDetailNetBean(source);
        }

        @Override
        public ProductDetailNetBean[] newArray(int size) {
            return new ProductDetailNetBean[size];
        }
    };
}
